//
//  JPushUploadDeviceTokenAPI.m
//  SmartWaterFilter
//
//  Created by JianWei Chen on 16/10/8.
//  Copyright © 2016年 JianWei Chen. All rights reserved.
//

#import "JPushUploadDeviceTokenAPI.h"


@implementation JPushUploadDeviceTokenAPI
{
    NSDictionary *_dic;
}
- (id)initWithDictionary:(NSDictionary *)dic
{
    if ([super init]) {
        _dic = dic;
    }
    return self;
}

- (NSString *)requestUrl
{
    return @"/jpush/upload_device_token";
}

- (YTKRequestMethod)requestMethod {
    return YTKRequestMethodPOST;
}

- (id)requestArgument {
    NSMutableDictionary *dic = [[NSMutableDictionary alloc]initWithDictionary:_dic];
    
    if (EXRACT_OBJECT(@"QuanSanToken")[@"token"] != nil) {
        [dic setValue:EXRACT_OBJECT(@"QuanSanToken")[@"token"] forKey:@"access_token"];
    }
    
    if (_dic[@"regid"]) {
        [dic setObject:_dic[@"regid"] forKey:@"regid"];
        
    }
//    [dic setValue:[UUID getUUID] forKey:@"app_ident"];
//    [dic setValue:@"IOS" forKey:@"app_type"];
//    [dic setValue:EXRACT_OBJECT(@"QuanPhone") forKey:@"telephone"];
//    
//    NSMutableDictionary *signDic = [[NSMutableDictionary alloc]initWithDictionary:dic];
//    NSDate *date = [NSDate date];
//    NSString *timeString = [date formattedDateWithFormat:@"yyyyMMdd"];
//    [signDic setValue:timeString forKey:@"dt"];
//    
    NSString *sign = [NSString getSign:dic];
//    NSString *sign=[NSString getSign:signDic byOrder:@[@"access_token",@"app_ident",@"app_type",@"telephone",@"regid",@"dt"]];
    [dic setObject:sign forKey:@"Sign"];
    
    return dic;
}

-(void)analyseResponseObject
{
//    [self getUserInfo];
}

- (void)getUserInfo
{
    
}


-(void)dealloc
{
    
}
@end
